package transforms;
import org.objectweb.asm.tree.MethodNode;

import com.rshacking.rhf.files.ClassContainer;
import com.rshacking.rhf.updater.Transform;
import com.rshacking.rhf.updater.hooks.HooksList;

public class InputTransforms extends Transform {

	@Override
	public boolean canActivate(HooksList hooks, ClassContainer cc) {
		return cc.getASM().interfaces.contains("java/awt/event/MouseMotionListener");
	}

	@Override
	public boolean execute(HooksList hooks, ClassContainer cc) {
		cc.getASM().interfaces.remove("java/awt/event/MouseMotionListener");
		cc.getASM().superName = "tester/interfaces/input/Mouse";
		for (MethodNode mn : cc.getASM().methods) {
			if (mn.name.equals("mouseMoved")) {
				mn.name = "_mouseMoved";
			}
		}
		return false;
	}
}